package com.railway.field.controller;

import com.railway.field.entity.ManufactureGirder;
import com.railway.field.page.CountList;
import com.railway.field.service.ManufactureGirderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Api(description = "制梁区接口")
@RestController
@RequestMapping("ManufactureGirder")
@CrossOrigin
public class ManufactureGirderController {
    @Autowired
    private ManufactureGirderService manufactureGirderService;

    @ApiOperation(value = "查询制梁区信息", notes = "传参:user_id")
    @PostMapping("/FindManufactureGirder")
    public List<ManufactureGirder> FindManufactureGirder(@RequestBody Map map) {
        return manufactureGirderService.FindManufactureGirder(map);
    }

    @ApiOperation(value = "统计数据", notes = "传参:user_id")
    @PostMapping("/CountList")
    public CountList CountList(@RequestBody Map map) {
        CountList countList = new CountList();
        countList.setCount_All(manufactureGirderService.CountAll(map));
        countList.setCount_Kx(manufactureGirderService.CountByState_Kx(map));
        countList.setCount_Zy(manufactureGirderService.CountByState_Zy(map));
        return countList;
    }
}
